package com.kehongborui.reflecttion;

/**
 * 用于 java  反射测试的类
 */
public class Student {
    /**
     * 学生姓名
     */
    private String name;
    /**
     * 地址
     */
    private String address;
    /**
     * 性别
     */
    private String sex;

    public String getAddress() {
        return address;
    }

    public void setAddress(String address) {
        this.address = address;
    }

    public String getSex() {
        return sex;
    }

    public void setSex(String sex) {
        this.sex = sex;
    }

    /**
     * 学生的年龄
     */
    public int age;

    public Student() {}

    public Student(String name, int age) {
        this.name = name;
        this.age = age;
    }

    private Student(String name) {
        this.name = name;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public int getAge() {
        return age;
    }

    public void setAge(int age) {
        this.age = age;
    }

    public void set(int age, String name) {
        this.age = age;
    }

    /**
     * 用于反射测试是否能获取私有方法
     */
    private void test() {}

    @Override
    public String toString() {
        return "Student{" +
                "name='" + name + '\'' +
                ", address='" + address + '\'' +
                ", sex='" + sex + '\'' +
                ", age=" + age +
                '}';
    }
}
